home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 19.zip / BS1 part 19 / Lattice C disk 4.adf / Compiler_Headers / exec / tasks.h < prev    next >
C/C++ Source or Header  |  1988-10-25  |  2KB  |  84 lines

  1. #ifndef EXEC_TASKS_H
  2. #define EXEC_TASKS_H
  3. /*
  4. **    $Filename: exec/tasks.h $
  5. **    $Release: 1.3 $
  6. **
  7. **    
  8. **
  9. **    (C) Copyright 1985,1986,1987,1988 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef EXEC_NODES_H
  14. #include "exec/nodes.h"
  15. #endif !EXEC_NODES_H
  16.  
  17. #ifndef EXEC_LISTS_H
  18. #include "exec/lists.h"
  19. #endif !EXEC_LISTS_H
  20.  
  21.  
  22. struct Task {
  23.     struct  Node tc_Node;
  24.     UBYTE   tc_Flags;
  25.     UBYTE   tc_State;
  26.     BYTE    tc_IDNestCnt;        /* intr disabled nesting*/
  27.     BYTE    tc_TDNestCnt;        /* task disabled nesting*/
  28.     ULONG   tc_SigAlloc;        /* sigs allocated */
  29.     ULONG   tc_SigWait;            /* sigs we are waiting for */
  30.     ULONG   tc_SigRecvd;        /* sigs we have received */
  31.     ULONG   tc_SigExcept;        /* sigs we will take excepts for */
  32.     UWORD   tc_TrapAlloc;        /* traps allocated */
  33.     UWORD   tc_TrapAble;        /* traps enabled */
  34.     APTR    tc_ExceptData;        /* points to except data */
  35.     APTR    tc_ExceptCode;        /* points to except code */
  36.     APTR    tc_TrapData;        /* points to trap code */
  37.     APTR    tc_TrapCode;        /* points to trap data */
  38.     APTR    tc_SPReg;            /* stack pointer        */
  39.     APTR    tc_SPLower;            /* stack lower bound    */
  40.     APTR    tc_SPUpper;            /* stack upper bound + 2*/
  41.     VOID    (*tc_Switch)();        /* task losing CPU      */
  42.     VOID    (*tc_Launch)();        /* task getting CPU     */
  43.     struct  List tc_MemEntry;        /* allocated memory */
  44.     APTR    tc_UserData;        /* per task data */
  45. };
  46.  
  47. /*----- Flag Bits ------------------------------------------*/
  48. #define TB_PROCTIME    0
  49. #define TB_STACKCHK    4
  50. #define TB_EXCEPT    5
  51. #define TB_SWITCH    6
  52. #define TB_LAUNCH    7
  53.  
  54. #define TF_PROCTIME    (1<<0)
  55. #define TF_STACKCHK    (1<<4)
  56. #define TF_EXCEPT    (1<<5)
  57. #define TF_SWITCH    (1<<6)
  58. #define TF_LAUNCH    (1<<7)
  59.  
  60. /*----- Task States ----------------------------------------*/
  61. #define TS_INVALID    0
  62. #define TS_ADDED    1
  63. #define TS_RUN        2
  64. #define TS_READY    3
  65. #define TS_WAIT        4
  66. #define TS_EXCEPT    5
  67. #define TS_REMOVED    6
  68.  
  69. /*----- Predefined Signals -------------------------------------*/
  70.  
  71. #define SIGB_ABORT    0
  72. #define SIGB_CHILD    1
  73. #define SIGB_BLIT    4
  74. #define SIGB_SINGLE    4
  75. #define SIGB_DOS    8
  76.  
  77. #define SIGF_ABORT    (1<<0)
  78. #define SIGF_CHILD    (1<<1)
  79. #define SIGF_BLIT    (1<<4)
  80. #define SIGF_SINGLE    (1<<4)
  81. #define SIGF_DOS    (1<<8)
  82.  
  83. #endif    /* EXEC_TASKS_H */
  84.